#include <iostream>
#define N 100

using namespace std;

void read_matrix(int matrix[N][N], int row, int column){
int i, j;
for (i=0;i<row;i++)
    for(j=0;j<column;j++){
        cout<<"m["<<i<<"]["<<j<<"]= ";
        cin>>matrix[i][j];}
}

void printVector(int array[], int elements){
for(int i=0; i<elements; i++){
	cout<<array[i]<<" ";}
	cout<<"\n";
}

int main(){
int row;
int column;
int matrix[N][N];
int elements=0;
int array[N];
int i,j;

cout<<"Type the number of rows: " ;
cin>>row;

cout<<"Type the number of columns: " ;
cin>>column;

read_matrix(matrix, row, column);

for(i=0; i<row; i++){
    for(j=0; j<column; j++){
        if(matrix[i][j]>0){
            array[elements]=matrix[i][j];
            elements++;}
    }
}

cout<<"The positive elements are: ";
printVector(array, elements);

return 0;
}
